OPC Studio User's Guide and Reference
Examples - OPC UA Application - Get registration information

.NET

// Shows how to get the OPC UA registration information for this application.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

using System;
using OpcLabs.EasyOpc.UA.Application;
using OpcLabs.EasyOpc.UA.Application.Extensions;
using OpcLabs.EasyOpc.UA.Discovery;

namespace UADocExamples.Application._IEasyUAClientServerApplication
{
    class GetApplicationElement
    {
        public static void Main1()
        {
            // Obtain the application interface.
            EasyUAApplication application = EasyUAApplication.Instance;

            // Get the OPC UA registration information for this application.
            UAApplicationElement applicationElement = application.GetApplicationElement();

            // Display results
            Console.WriteLine("Application element:");
            Console.WriteLine("  Application name: {0}", applicationElement.ApplicationName);
            Console.WriteLine("  Application type: {0}", applicationElement.ApplicationType);
            Console.WriteLine("  Application URI string: {0}", applicationElement.ApplicationUriString);
            Console.WriteLine("  Discovery URI strings: {0}", applicationElement.DiscoveryUriStrings);
            Console.WriteLine("  Product URI string: {0}", applicationElement.ProductUriString);
        }
    }
}
# Shows how to get the OPC UA registration information for this application.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System import *
from OpcLabs.EasyOpc.UA.Application import *
from OpcLabs.EasyOpc.UA.Application.Extensions import *
from OpcLabs.EasyOpc.UA.Discovery import *


# Obtain the application interface.
application = EasyUAApplication.Instance

# Get the OPC UA registration information for this application.
applicationElement = IEasyUAClientServerApplicationExtension.GetApplicationElement(application)

# Display results.
print('Application element:')
print('  Application name: ', applicationElement.ApplicationName, sep='')
print('  Application type: ', Enum.Format(UAApplicationTypes, applicationElement.ApplicationType, 'G'), sep='')
print('  Application URI string: ', applicationElement.ApplicationUriString, sep='')
print('  Discovery URI strings: ', applicationElement.DiscoveryUriStrings, sep='')
print('  Product URI string: ', applicationElement.ProductUriString, sep='')

print()
print('Finished.')
' Shows how to get the OPC UA registration information for this application.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Imports Microsoft.Extensions.DependencyInjection
Imports OpcLabs.EasyOpc.UA
Imports OpcLabs.EasyOpc.UA.Application
Imports OpcLabs.EasyOpc.UA.Application.ComTypes
Imports OpcLabs.EasyOpc.UA.Application.Extensions

Namespace Application._IEasyUAClientServerApplication
    Friend Class GetApplicationElement
        Public Shared Sub Main1()
            ' Obtain the application interface.
            Dim application As EasyUAApplication = EasyUAApplication.Instance

            ' Get the OPC UA registration information for this application.
            Dim applicationElement = application.GetApplicationElement()

            ' Display results
            Console.WriteLine("Application element:")
            Console.WriteLine("  Application name: {0}", applicationElement.ApplicationName)
            Console.WriteLine("  Application type: {0}", applicationElement.ApplicationType)
            Console.WriteLine("  Application URI string: {0}", applicationElement.ApplicationUriString)
            Console.WriteLine("  Discovery URI strings: {0}", applicationElement.DiscoveryUriStrings)
            Console.WriteLine("  Product URI string: {0}", applicationElement.ProductUriString)
        End Sub
    End Class
End Namespace

COM

// Shows how to get the OPC UA registration information for this application.
//
// Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

class procedure GetApplicationElement.Main;
var
  Application: TEasyUAApplication;
  ApplicationElement: _UAApplicationElement;
begin
  // Obtain the application interface.
  Application := TEasyUAApplication.Create(nil);

  // Get the OPC UA registration information for this application.
  ApplicationElement := Application.GetApplicationElement;

  // Display results
  WriteLn('Application element:');
  WriteLn('  Application name: ', ApplicationElement.ApplicationName);
  WriteLn('  Application type: ', ApplicationElement.ApplicationType);
  WriteLn('  Application URI string: ', ApplicationElement.ApplicationUriString);
  WriteLn('  Discovery URI string: ', ApplicationElement.DiscoveryUriString);
  WriteLn('  Product URI string: ', ApplicationElement.ProductUriString);
end;
See Also

Conceptual